<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>安装</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="opcache.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="opcache.configuration.html">运行时配置</a></div>
 <div class="up"><a href="opcache.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="opcache.installation" class="sect1">
 <h2 class="title">安装</h2>

 <p class="para">
  The process of installing OPcache varies depending on which version of PHP
  you&#039;re running. Please refer to the appropriate section below.
 </p>

 <blockquote class="note"><p><strong class="note">Note</strong>: 
  <p class="para">
   If you want to use OPcache with
   <a href="http://xdebug.org/" class="link external">&raquo;&nbsp;Xdebug</a>, you must load OPcache before
   Xdebug.
  </p>
 </p></blockquote>

 <div class="sect2" id="opcache.installation.bundled">
  <h3 class="title">PHP 5.5.0 and later</h3>

  <p class="para">
   OPcache can only be compiled as a shared extension. If you have
   disabled the building of default extensions with
   <strong class="option configure">--disable-all</strong>
, you must compile PHP with
   the <strong class="option configure">--enable-opcache</strong>
 option for OPcache
   to be available.
  </p>
  
  <p class="para">
   Once compiled, you can use the
   <a href="ini.core.html#ini.zend-extension" class="link">zend_extension</a> configuration
   directive to load the OPcache extension into PHP. This can be done with
   <em>zend_extension=/full/path/to/opcache.so</em> on non-Windows
   platforms, and <em>zend_extension=C:\path\to\php_opcache.dll</em>
   on Windows.
  </p>
 </div>

 <div class="sect2" id="opcache.installation.pecl">
  <h3 class="title">PHP 5.2, 5.3 and 5.4</h3>

  <p class="para">
   此 <a href="http://pecl.php.net/" class="link external">&raquo;&nbsp;PECL</a> 扩展未与
PHP 捆绑。
  </p>

  <p class="para">
   安装此 PECL 扩展相关的信息可在手册中标题为
<a href="install.pecl.html" class="link">PECL
扩展的安装</a>章节中找到。更多信息如新的发行版本、下载、源文件、
维护人员信息及变更日志等，都在此处：
   <a href="http://pecl.php.net/package/ZendOpcache" class="link external">&raquo;&nbsp;http://pecl.php.net/package/ZendOpcache</a>.
  </p>

  <p class="para">
   <acronym title="PHP Extension and Application Repository">PECL</acronym> 扩展的
<acronym title="Dynamic Link Library">DLL</acronym> 当前不可用。参见
<a href="install.windows.building.html" class="link">在 Windows 上构建</a>章节。
  </p>
 </div>

 <div class="sect2" id="opcache.installation.recommended">
  <h3 class="title">Recommended php.ini settings</h3>

  <p class="para">
   The following settings are generally recommended as providing good
   performance:
  </p>

  <div class="informalexample">
   <div class="example-contents">
<div class="cdata"><pre>
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
</pre></div>
   </div>

  </div>

  <p class="para">
   You may also want to consider disabling
   <a href="opcache.configuration.html#ini.opcache.save-comments" class="link">opcache.save_comments</a>
   and enabling
   <a href="opcache.configuration.html#ini.opcache.enable-file-override" class="link">opcache.enable_file_override</a>,
   however note that you will have to test your code before using these in
   production as they are known to break some frameworks and applications,
   particularly in cases where documentation comment annotations are used.
  </p>

  <p class="para">
   A full list of configuration directives supported by OPcache
   <a href="opcache.configuration.html" class="link">is also available</a>.
  </p>
 </div>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="opcache.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="opcache.configuration.html">运行时配置</a></div>
 <div class="up"><a href="opcache.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
